<template>
<!-- 根部必须有一个div：包含所有内容 -->
  <div class="home">
    

    <el-container>
      <el-header>
        <Navigation :username = "username"></Navigation>
      </el-header>
      <el-container>
        <el-aside width="200px">Aside</el-aside>
        <el-main>
          <el-image style="height: 100%" :src="'https://api.dujin.org/bing/1920.php'"></el-image>
        </el-main>
      </el-container>
    </el-container>


  </div>
</template>





<script>
import Navigation from "../../components/Navigation.vue"
import api from '../../utils/api.js'


export default {

  // 名字
  name: 'Home',

  // 数据
  data(){
    return {
      age:22,
      dog:{name:"嘟嘟"},
      lists:[],
      btn:true,
      username:'小明',
      password:''
    }
  },

  // 引入(注册)组件
  components:{
    Navigation
  },

  // 方法
  methods:{

    // 方法名：function(参数){方法体}，
    login:function(){
      var username = this.username
      var password = this.password
      // 请求后台的登录接口
    
      var path1 = api.api+"/user/login?username="+ username+"&passwword="+password
      var path = api.api+"/user/list"
      var json = "a.json"

      this.axios
      .get(path)
      .then(response=>{
        console.log(response)
        this.lists = response.data
      }) 
      // this.axios.post
    },

    reg:function(){

    }

  },

  // 生命周期方法
  // 名字固定
  // 在当前页面的某个状态：自动执行
  beforeMount(){

  },

  mounted(){
    // 数据请求 当前需要的数据

  },
}
</script>




<style>
  .el-header, .el-footer {
    background-color: #B3C0D1;
    color: #333;
    text-align: center;
    line-height: 60px;
  }
  
  .el-aside {
    background-color: #D3DCE6;
    color: #333;
    text-align: center;
    line-height: 200px;
  }
  
  .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
    line-height: 160px;
  }
  
  body > .el-container {
    margin-bottom: 40px;
  }
  
  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }
  
  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }
</style>
